package com.example.zhouqiong.richeditotandroid.db.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.example.zhouqiong.richeditotandroid.db.entity.BabyEntity;

import java.util.List;

@Dao
public interface DiaryEntityDao {

    @Query("Select * from diary_entity")
    List<BabyEntity> getAll();

    @Query("Select * from diary_entity Where id In (:id)")
    BabyEntity loadBy(int id);

    @Query("Select * from diary_entity Where birthday = (:date)")
    BabyEntity loadByDate(long date);

    @Insert
    void insertAll(BabyEntity... users);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(BabyEntity... users);

    @Delete
    void delete(BabyEntity... users);

    @Update
    void update(BabyEntity... users);

//    @Query("update videobean set id =:videoId where date=:uid")
//    void updateCustom(String videoId, int uid);
}
